﻿using System.Collections.Generic;
using Inovout.Repositories;

namespace Inovout.Services
{
    public class RepositoryService<TEntity> : BaseService, IRepositoryService<TEntity>, IRepositoryService where TEntity : class
    {
        public void Save(TEntity model)
        {
            throw new System.NotImplementedException();
        }
        protected virtual IRepository<TEntity> Repository
        {
            get { return repository as IRepository<TEntity>; }
        }
        public IList<TEntity> FindAll()
        {
            return Repository.FindAll();
        }



        public virtual TEntity FindById(object id)
        {
            throw new System.NotImplementedException();
        }

        void IRepositoryService.Save(object model)
        {
            this.Save((TEntity)model);
        }

        object IRepositoryService.FindById(object id)
        {
            return FindById(id);
        }
    }
}
